package com.toy.abash.domain;

import java.util.Date;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import com.toy.core.domain.BaseObject;

/**
 * 糗事
 */
@CompoundIndexes(value={
		@CompoundIndex(name="hotOrder_-1_id_-1",def="{'hotOrder': -1, '_id': -1}")
})
@Document(collection="T_ABASH")
public class Abash implements BaseObject{
	
	private static final long serialVersionUID = -8609553952294975865L;
	
	public static int STATE_NORMAL = 0;
	public static int STATE_HIDDEN = 1;
	
	@Id
	private long id;
	
	@Indexed 
	private long authorId;//发布人
	@Indexed
	private Date publishDate;//发布时间
	private String content; //发布内容
	private boolean anonymousPost; //匿名提交
	private String[] tags; //tag信息
	private String[] images; //图片信息
	@Indexed
	private int state; //状态
	private String ipaddress;//ip地址
	
	private int toUpNum; //顶个数
	private int toDownNum; //操个数
	private int replyNum; //回复个数	
	@Indexed 
	private int hotOrder; //热门排序标准 toUpNum+replyNum-toDownNum;
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}
	
	public Date getPublishDate() {
		return publishDate;
	}

	public void setPublishDate(Date publishDate) {
		this.publishDate = publishDate;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String[] getTags() {
		return tags;
	}

	public void setTags(String[] tags) {
		this.tags = tags;
	}

	public String[] getImages() {
		return images;
	}

	public void setImages(String[] images) {
		this.images = images;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public String getIpaddress() {
		return ipaddress;
	}

	public void setIpaddress(String ipaddress) {
		this.ipaddress = ipaddress;
	}

	public boolean isAnonymousPost() {
		return anonymousPost;
	}

	public void setAnonymousPost(boolean anonymousPost) {
		this.anonymousPost = anonymousPost;
	}

	public int getToUpNum() {
		return toUpNum;
	}

	public void setToUpNum(int toUpNum) {
		this.toUpNum = toUpNum;
	}

	public int getToDownNum() {
		return toDownNum;
	}

	public void setToDownNum(int toDownNum) {
		this.toDownNum = toDownNum;
	}

	public int getReplyNum() {
		return replyNum;
	}

	public void setReplyNum(int replyNum) {
		this.replyNum = replyNum;
	}

	public int getHotOrder() {
		return hotOrder;
	}

	public void setHotOrder(int hotOrder) {
		this.hotOrder = hotOrder;
	}

	public long getAuthorId() {
		return authorId;
	}

	public void setAuthorId(long authorId) {
		this.authorId = authorId;
	}
	
}
